version 15
set more off  
clear
capture log close
macro drop _all 

*---------------------------------------------------------------------------*       				
* PROJECT: COMPLAINTS HR	  	    		    							*
* DO FILE: JOINT OPERATIONS FIGURE											*
* AUTHORS: FLORES-MACIAS AND ZARKIN                    						*
* JANUARY 2023              				         						*
*---------------------------------------------------------------------------*       				

*--------------------------------------------------------------------*
* STEP 1: GLOBALS, ADD WORKING DIRECTORY HERE 				 		 *
*--------------------------------------------------------------------*

gl fig ""
gl final ""

*--------------------------------------------------------------------*
* STEP 2: LOAD DATA 				 								 *
*--------------------------------------------------------------------*	

use "$final/OperativosComparison.dta", clear

*--------------------------------------------------------------------*
* STEP 3: FIGURE 6 - SERIOUS HR COMPLAINTS RATE PER 1,000 PERSONNEL  *
* IN STATES WITH JOINT OPERATIONS				 					 *
*--------------------------------------------------------------------*	

	
graph bar sedratesub pfratesub, over(yearop, label(valuelabels labsize(tiny))) ///
	over(statename, label(labsize(vsmall))) ///
	legend(label(1 "SEDENA") label(2 "POLFED") position(6) r(1)) ///
	ylabel(0(20)100, labsize(vsmall)) bar(1, bcolor(black)) bar(2, bcolor(gs10)) ///
	ytitle("Average rate of serious HR complaints per 1,000 personnel", size(small))
				
	graph export "$fig/FIG6.png", replace
	
	* Note: for identical figures install and use the tab1 scheme; ssc install schemepack, replace

